<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <base th:href="@{/}">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
</head>
<body>
<!--学生：查询学生考试成绩交互界面-->
    <div class="easyui-tabs" style="width:100%;height:100%">
        <div title="查询学生考试成绩" style="padding:3px">
            <table id="dg_queryStudentScore" style="height:100%">
            </table>
            <div id="queryStudentScore_toolbar">
                <input name="studentIdCard" id="dg_studentIdCard"  hidden="hidden" th:value="${session.studentonline.studentIdCard}">
                <input name="studentName" id="dg_studentName"  hidden="hidden" th:value="${session.studentonline.studentName}">
                <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-export" plain="true" onclick="doExportStudentOwnScore()">导出</a>
            </div>
        </div>
    </div>

<script type="text/javascript" th:inline="none">
    $(function () {
        //分页参数
        let pageParam = {
            pageSize: 70,							//每页显示的记录条数，默认为70
            pageList: [70, 150, 300, 500, 1000],	//可以设置每页记录条数的列表
            beforePageText: '第',				//页数文本框前显示的汉字
            afterPageText: '页    共 {pages} 页',
            displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录',
        }
        //查询学生自己的成绩
        $("#dg_queryStudentScore").datagrid({
            url: "queryStudentOwnScore",
            queryParams:{
               studentIdCard:$("#dg_studentIdCard").val()
            },
            toolbar: "#queryStudentScore_toolbar",
            pagination: true,
            pageSize: 70,
            rownumbers: true,
            fitColumns: false,
            singleSelect: true, // 单行
            fit: true,
            columns: [[
                {field: 'chk', checkbox: true, width: 50},
                {field: 'gradeName', title: '年级名称', align:'center',width: 120},
                {field: 'teamName', title: '班级', align:'center',width: 150},
                {field: 'semesterName', title: '学期',align:'center', width: 120},
                {field: 'examName', title: '考试名称', align:'center',width: 300},
                {field: 'chinese', title: '语文', align:'center',width: 40},
                {field: 'maths', title: '数学', align:'center',width: 40},
                {field: 'english', title: '英语', align:'center',width: 40},
                {field: 'physics', title: '物理', align:'center',width: 40},
                {field: 'history', title: '历史', align:'center',width: 40},
                {field: 'chemistry', title: '化学', align:'center',width: 40},
                {field: 'biology', title: '生物', align:'center',width: 40},
                {field: 'politics', title: '政治', align:'center',width: 40},
                {field: 'geography', title: '地理', align:'center',width: 40},
                {field: 'sports', title: '体育', align:'center',width: 40},
                {field: 'total', title: '总分', align:'center',width: 40},
                {field: 'categoryName', title: '分类',align:'center', width: 100}
            ]]
        });
        let queryStudentScorePage= $("#dg_queryStudentScore").datagrid("getPager");
        $(queryStudentScorePage).pagination(pageParam);
    });
    //导出查询成绩doExportStudentOwnScore
    function doExportStudentOwnScore(){
        $('#dg_queryStudentScore').datagrid('toExcel', {
            filename:  $("#dg_studentName").val()+'学生成绩表.xls',
            worksheet: 'sheet1'
        });
    }
</script>
</body>
</html>